package com.realdolmen.jcc.mobileSquad.domain
{
	/**
	 * Simple ActionScript domain object representing a Contact
	 * @author DOMSIEBE
	 */
	[Bindable]
	public class Contact {
		private static const DEFAULT_PHOTO:String = "contact/default.png"; 
		public var firstName:String;
		public var lastName:String;
		public var phone:String;
		public var email:String;
		public var photo:String;
		
		/**
		 * The constructor of Contact 
		 * @param id The database id
		 * @param firstName The first name
		 * @param lastName The last name
		 * @param phone The phone
		 * @param email The email
		 * @param photo A link to the phot of the contact person
		 */		
		public function Contact(firstName:String="", 
								lastName:String="", 
								phone:String="",
								email:String="",
								photo:String=DEFAULT_PHOTO){
			this.firstName = firstName;
			this.lastName = lastName;
			this.phone = phone;
			this.email = email;
			this.photo = photo;
		}
		
		/**
		 * Returns true if the contact has a picture.
		 * False if not.
		 * @return True if the contact has a picture.
		 */ 
		public function get hasPhoto():Boolean{
			if(photo != DEFAULT_PHOTO){
				return true;
			}
			return false;
		}
	}
}